﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace WP7.LockerPlayer.ViewModels
{
    public class AlbumViewModel
    {
        public string AlbumId { get; set; }
        public string AlbumTitle { get; set; }
        public string ArtistId { get; set; }
        public string ArtistName { get; set; }
        public string TrackCount { get; set; }
        public long? AlbumSize { get; set; }
        public int? HasArt { get; set; }
        public string AlbumArtUrl { get; set; }

        
        public string TrackCountMessage
        {
            get;
            set;
        }
        //public void SetTrackCountMessage( string trackCount)
        //{
        //    if (!string.IsNullOrEmpty(trackCount))
        //    {
        //        this.TrackCountMessage = trackCount + " Tracks.";
        //    }
        //    else
        //    {
        //        this.TrackCountMessage = "0 Tracks";
        //    }
        //}
        public AlbumViewModel()
        {

        }
        public static int CompareByName(object obj1, object obj2)
        {
            AlbumViewModel p1 = (AlbumViewModel)obj1;
            AlbumViewModel p2 = (AlbumViewModel)obj2;

            int result = p1.AlbumId.CompareTo(p2.AlbumId);

            return result;
        }
        public static string GetFirstNameKey(AlbumViewModel artist)
        {
            char key = char.ToLower(artist.AlbumTitle[0]);

            if (key < 'a' || key > 'z')
            {
                key = '#';
            }

            return key.ToString();
        }
    }
}
